package com.health.medicine.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.health.api.model.transporter.TransporterRegisterRequest;
import com.health.common.model.vo.UserKeyVO;
import com.health.medicine.model.dto.medicine.TransportGoodsRequest;
import com.health.medicine.model.dto.transporter.TransportGoodsArrivedRequest;
import com.health.medicine.model.dto.transporter.TransportVehiclesRequest;
import com.health.medicine.model.entity.TransportRecords;
import com.health.medicine.model.entity.TransportUnit;
import com.health.medicine.model.entity.TransportUnitVehicles;
import jakarta.servlet.http.HttpServletRequest;
import org.fisco.bcos.sdk.v3.codec.ContractCodecException;
import org.fisco.bcos.sdk.v3.transaction.model.exception.TransactionBaseException;

/**
* @author zhexueqi
* @description 针对表【TransportUnit(运输单位信息表)】的数据库操作Service
* @createDate 2024-08-30 15:46:19
*/
public interface TransportunitService extends IService<TransportUnit> {
    /**
     * 注册运输商到mysql
     * @param transactionRegisterRequest
     * @return
     */
    Boolean createTransporterToMysql(TransporterRegisterRequest transactionRegisterRequest);

    /**
     * 注册运输商
     * @param userKeyVO
     * @param userAccount
     * @throws TransactionBaseException
     * @throws ContractCodecException
     */
    void createTransporter(UserKeyVO userKeyVO, String userAccount) throws TransactionBaseException, ContractCodecException;

    /**
     * 运输商品
     * @param transportGoodsRequest
     * @return
     * @throws TransactionBaseException
     * @throws ContractCodecException
     */
    Boolean transportGoods(TransportGoodsRequest transportGoodsRequest) throws TransactionBaseException, ContractCodecException;

    /**
     * 创建车辆
     * @param transportVehiclesRequest
     * @return
     */
    Boolean createVehicle(TransportVehiclesRequest transportVehiclesRequest);

    /**
     * 运输商品到达
     * @param transportGoodsArrivedRequest dto
     * @return 是否成功
     * @throws TransactionBaseException
     * @throws ContractCodecException
     */
    Boolean transportGoodsArrived(TransportGoodsArrivedRequest transportGoodsArrivedRequest) throws TransactionBaseException, ContractCodecException;

    /**
     * 分页查询运输记录
     * @param pageNum 页码
     * @param pageSize 页大小
     * @param request    请求
     * @return 运输记录
     */
    Page<TransportRecords> getTransportGoods(int pageNum, int pageSize, HttpServletRequest request);

    /**
     * 分页查询车辆信息
     * @param pageNum 页码
     * @param pageSize 页大小
     * @param request 请求
     * @return 车辆信息
     */
    Page<TransportUnitVehicles> getTransportVehicles(int pageNum, int pageSize,HttpServletRequest request);
}
